
/**
 * filter.h
 * 
 * Filter is the base class of Tweet filter
 * 
 * Copyright (c) 2008 Harunobu Oyama <nobukichi at gmail.com>
 * Licensed under GNU GPL version 3
 *
 */

#ifndef		FILTER_INCLUDED
#define		FILTER_INCLUDED

#include <boost/shared_ptr.hpp>
#include <QString>

class Tweet;

class Filter
{
public:
	virtual ~Filter();

	//! initialize filter before using this.
	//! this can be useful if the filter counts something
	virtual void init() {}
	
	//! return true, if the filter show the tweet on the view
	virtual bool test(const Tweet& tweet) = 0;

	QString name();

protected:
	explicit Filter(const QString& name = "");

private:
	QString filterName;
};

typedef boost::shared_ptr<Filter> FilterPtr;

#endif	//	FILTER_INCLUDED

